package com.qiantu.phone.ui.dialog;

import android.content.Context;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.hjq.base.BaseDialog;
import com.qiantu.phone.R;
import com.qiantu.phone.app.AppApplication;


public final class WaitFinishDialog {
    public static final class Builder
            extends BaseDialog.Builder<Builder> {

        private final ProgressBar iconWait;
        private final TextView tvContent;

        public Builder(Context context) {
            super(context);

            setContentView(R.layout.wait_finish_dialog);
            setCancelable(false);
            setCanceledOnTouchOutside(false);
            setWidth(getResources().getDimensionPixelSize(R.dimen.dp_180));
            iconWait = findViewById(R.id.icon_wait);
            tvContent = findViewById(R.id.tv_content);
        }

        public Builder setIconWait(int resId) {
            iconWait.setIndeterminateDrawable(AppApplication.getInstance().getThemeDrawable(resId));
            return this;
        }

        public Builder setTvContent(String content) {
            tvContent.setText(content);
            return this;
        }

        public Builder setTvContent(int resId) {
            tvContent.setText(resId);
            return this;
        }

        @Override
        public BaseDialog create() {
            return super.create();
        }
    }
}
